home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS03.ADF
/
AmigaBasicProgs
/
Graph-Routines
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1986-04-02
|
8KB
|
265 lines
Start:
1 GetLabel:
WINDOW 2,"Set Label",(1,50)-(600,100)
LOCATE 1,1
COLOR 3
PRINT "Value Indicator"
LINE (70,9)-(70,13),1
GET (0,0)-(120,13),mov%
PUT (0,0),mov%
CLS
COLOR 2
PRINT"Last Value=";Label
LOCATE 5,40
COLOR 2,3
PRINT "Cancel","PI=3.141592654"
COLOR 2
LINE (0,20)-(600,20),1
LINE (2,15)-(2,25),1
last=MOUSE(1)
PUT (last-70,10),mov%
WHILE MOUSE(0)<>-1
current=MOUSE(1)
IF last<>current THEN
PUT (last-70,10),mov%
last=current
PUT (last-70,10),mov%
LOCATE 5,1
PRINT "Label=";ABS(2-last)/xscale;" ";
END IF
WEND
WINDOW 1
WINDOW CLOSE 2
IF MOUSE(2)>30 THEN
IF last>447 THEN
Label=5.30795e-315
ELSE
Label=Label
END IF
ELSE
Label=ABS(2-last)/xscale
END IF
CHAIN "Graph-Main",2,ALL
2 Accuracy:
WINDOW 2,"Accuracy",(1,50)-(600,100)
LOCATE 1,1
COLOR 3
PRINT "Value Indicator"
LINE (70,9)-(70,13),1
GET (0,0)-(120,13),mov%
PUT (0,0),mov%
LOCATE 5,40
COLOR 2,3
PRINT "Cancel"
COLOR 2
LOCATE 1,1
PRINT "Last Setting=";points
lastp=points
LINE (0,20)-(600,20),1
LINE (2,15)-(2,25),1
last=MOUSE(1)
PUT (last-70,10),mov%
WHILE MOUSE(0)<>-1
current=MOUSE(1)
IF last<>current THEN
PUT (last-70,10),mov%
last=current
PUT (last-70,10),mov%
LOCATE 5,1
PRINT "Accuraccy=";ABS(2-last);" ";
END IF
WEND
WINDOW 1
WINDOW CLOSE 2
points=ABS(2-last)
IF MOUSE(2)>30 THEN points=lastp
CHAIN "Graph-Main",2,ALL
3 Help:
PALETTE 1,0.4,0.75,1
GET (601,10)-(617,180),mov%
WINDOW 3,"Help Menu",(12,1)-(630,185),0
COLOR 3
LOCATE 1,1
PRINT TAB(56)"Other Menus"
PRINT
COLOR 2
PRINT TAB(51)"Additional Information"
PRINT TAB(51)"Quick List"
PRINT TAB(51)"Changing The Function"
PRINT TAB(51)"Zooming in on Sections"
PRINT TAB(51)"Using Accuraccy and Label"
PRINT
PRINT TAB(51)"Exit Help Menu"
COLOR 3
LOCATE 1,1
LINE (0,0)-(392,200),0,bf
last=2
GOTO Helpmenu2
HelpMenu.Control:
LINE (394,150)-(600,158),1,bf
GET (392,150)-(600,159),ve%
PUT (392,150),ve%
PUT (392,last*8+7),ve%
WHILE MOUSE(0)=-1
COLOR 3
LOCATE 12,51
PRINT"Click Right Button "
PRINT TAB(51)"Before Making Menu Selection"
WEND
LOCATE 12,51
PRINT "Make Menu Selection"
PRINT TAB(51)"Then Click Mouse "
WHILE MOUSE(0)>-1
current=INT(MOUSE(2)/8)-1
IF last<>current AND current>0 AND current<8 THEN
PUT (392,last*8+7),ve%
last=current
PUT (392,last*8+7),ve%
END IF
WEND
PUT (392,last*8+7),ve%
LINE (0,0)-(392,200),0,bf
LOCATE 23,50
PRINT " ";
ON last GOTO Helpmenu1,Helpmenu2,Helpmenu3,Helpmenu4,Helpmenu5,Exit.Helpmenu
Exit.Helpmenu:
WINDOW 1
WINDOW CLOSE 3
PALETTE 1,0,1,0
LINE (0,1)-(0,179),1
GET (0,1)-(0,179),ve%
CHAIN "Graph-Main",1,ALL
Helpmenu1:
COLOR 1
LOCATE 1,1
PRINT"Graph It V1.0
PRINT"By Flynn D. Fishman
PRINT"January 1,1986
PRINT
PRINT"Please Note that this is not the Final version
PRINT"Since I am waiting for AmigaBasic Documentation
PRINT"I also appologize for the need to Chain but
PRINT"I found that I could not supply the program I
PRINT"Wanted to in 25k."
PRINT
PRINT"I have Also noticed that the Amiga sometimes
PRINT"Reboots while going from one program to another
PRINT"If you can solve this Bug I would Appreciate it
PRINT"I believe that it has something to do with Memory
PRINT"Control.
PRINT"You can also feel free to enhance this program in
PRINT"Anyway that you could think off"
GOTO HelpMenu.Control
Helpmenu2:
COLOR 1
LOCATE 1,1
PRINT " -Move the Graph Left"
PRINT " -Move the Graph Right"
PRINT " -Xpand the Graph On the X-Axis"
PRINT " -Move the Graph one Page Right"
PRINT " -Move the Graph one Page Left"
PRINT " -Move the Graph Up"
PRINT " -Move the Graph Down"
PRINT " -Expand the Graph On the Y-Axis"
PRINT " -Move The Graph up one Page"
PRINT " -Move The Graph down one Page"
PRINT " -Edit the Spacing Between the Graph's Labels"
PRINT " -Edit the Accuracy of the Graph"
PRINT " -Sho ";:COLOR 2:PRINT "(Not Available)";:COLOR 1:PRINT " lculations (X,Y,Slope)"
PRINT " -Return to the Origion"
PRINT " -Quit and exit to Basic"
PRINT " -Help (This menu)"
FOR i=15 TO 1 STEP -1
GET (16,i*8)-(375,i*8+8),ve%
PUT (16,i*8),ve%
PUT (18,i*10+1),ve%,PSET
NEXT
PUT (0,0),mov%
LOCATE 22,1
PRINT "To make a Selection Point to the Desired Icon and
PRINT "Hold Down Button Until The desired level is reahed";
GOTO HelpMenu.Control
Helpmenu3:
LOCATE 1,1
COLOR 3
PRINT "Changing the Function"
PRINT
COLOR 1
PRINT "In Order to keep this program Fast
PRINT "I placed the Function to be graphed
PRINT "in the Program as a defined FUNCTION
PRINT
PRINT "In Order to Change the Function"
PRINT "You Need to change FN Z(x)
PRINT
PRINT "You do this by First exiting The Program
PRINT "By pointing at the Quit Icon
PRINT "Then
PRINT "-enter 'LIST FORMULA'"
PRINT "-delete the old formula
PRINT "-enter your Formula after the DEF FN z(xmin)="
PRINT "You Can now run the program with your Function
GOTO HelpMenu.Control
Helpmenu4:
COLOR 3
LOCATE 1,1
PRINT "Zooming In on An Area"
COLOR 1
PRINT
PRINT "It is possible to Zoom in on an area by
PRINT "moving the Mouse to a point on the graph.
PRINT "Then while you hold down the Left Mouse
PRINT "Button, Move to the other Corner of the
PRINT "area that you wish to examine and release
PRINT "the Right Mouse Button
PRINT "The Marked Area will now be displayed
PRINT
PRINT "It is possible to view more of the graph by
PRINT "pointing the mouse at the Two Expand Icons
PRINT "And then holding down the Left Mouse Button
PRINT "Until the desired size is achieved
PRINT "Note: That as you hold down the button the
PRINT "program shows you how much of the screen the
PRINT "current portion will take in the new Plot"
GOTO HelpMenu.Control
Helpmenu5:
LOCATE 1,1
COLOR 3
PRINT "Changing the Accuracy and Labels
COLOR 1
PRINT
PRINT "The Accuracy is defined by how many Points are"
PRINT "calculated for each screen There are 600 points"
PRINT "on the screen and and the accuracy defaults"
PRINT "to 100 points
PRINT "Note that the higher the accuracy the
PRINT "Slower the Program
PRINT
PRINT "The Labels are the lines that are drawn
PRINT "On the X and Y axis at set intervals
PRINT
PRINT "To change the accuracy or the Labels First"
PRINT "Point to the Accuracy or Label Icon and as"
PRINT "you hold down the Button Move the value"
PRINT "Indicater back and forth along the line."
PRINT "Release the button when you are finished and the
PRINT "new setting will be used
PRINT "Note also that if you do not want a new setting
PRINT "you can point at the Cancel box when you release
PRINT "Also on the Label Setting you can get PI by
PRINT "Pointing at the PI box when you release";
GOTO HelpMenu.Control
Finish: